//   ! 用户界面渲染
function render() {
    axios.get('/user/getUserInfo', )
        .then(({
            data: {
                data
            }
        }) => {
            const {
                articleNum,
                collectNum,
                zanNum
            } = data
            $('.btn-box').html(`
            <a href="user-add.html" class="button"><i class="fa fa-plus"></i>立即发布文章</a>
            <a href="user-collect.html" class="button"><i class="fa fa-heart"></i>收藏了 <b>${collectNum}</b>篇文章</a>
            <a href="user-zan.html" class="button"><i class="fa fa-thumbs-up"></i>点赞了 <b>${zanNum}</b>篇文章</a>
            <a href="user-list.html" class="button"><i class="fa fa-tasks"></i>发布了 <b>${articleNum}</b>篇文章</a>
            `)
            // console.log(data.userInfo);
            const userInfo = data.userInfo
            localStorage.setItem('userInfo', JSON.stringify(userInfo))
            // console.log(userInfo)
            const {
                icon,
                id,
                mobile,
                notes,
                sex,
                username,
                birthday
            } = data.userInfo
            let picIng = `http://124.223.14.236:8060/${icon}`
            $('#text').html(`
            <a href="" class="user-icon"><img src="${icon===null?"../src/images/default.png":picIng}" alt=""></a>
            <div class="text">
              <h3>${username} <span><b>个性宣言</b>:${notes}</span></h3>
              <p>
                性别：${sex===0?"男":"女"}<span> |</span>
                手机号：${mobile} <span>|</span>
                出生年月：${birthday}
              </p>
            </div>
            <a href="user-edit.html"><i style="font-size: 20px; cursor: pointer; " class="fa fa-cogs"></i></a>
            `)
        })
}
render()
